<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateFriendAppliesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('friend_applies', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->comment('用户ID');
            $table->integer('applier_user_id')->comment('申请人用户ID');
            $table->string('msg',20)->comment('申请好友的备注信息');
            $table->integer('status')->default(0)->comment('状态：0未确认1已添加2拒绝3已过期');
            $table->timestamps();
        });
        DB::statement("alter table `friend_applies` comment'朋友申请表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('friend_applies');
    }
}
